#include<iostream>
#include<iomanip>
#include<algorithm>
using namespace std;
struct node
{
	int t,num;
	bool operator < (const node &x) const
	{
		return t<x.t;
	}
}stu[1001];

int main()
{
	int n,sum=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>stu[i].t;
		stu[i].num=i;
	}
	sort(stu+1,stu+n+1);
	for(int i=1;i<=n;i++)
	{
		cout<<stu[i].num<<" ";
		stu[i].t+=stu[i-1].t;
		sum+=stu[i].t;
	}
	printf("\n%.2f",sum*1.0/n);
    return 0;
}
